using ASP;
using IPMS.AccessAuth;
using System;
using System.Configuration;
using System.Globalization;
using System.Threading;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using Resources;
public partial class Settings : Page, IRequiresSessionState
{
    protected void btnSave_Click(object sender, EventArgs e)
    {
        this.Save();
    }

    protected override void InitializeCulture()
    {
        string sCulture = ConfigurationManager.AppSettings["DefaultCulture"].ToString();
        try
        {
            sCulture = this.Session["Culture"].ToString();
        }
        catch (NullReferenceException)
        {
        }
        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(sCulture);
        Thread.CurrentThread.CurrentUICulture = new CultureInfo(sCulture);
        base.InitializeCulture();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            ((Label)this.Master.FindControl("lblMstTitle")).Text = " | " + ISitemap.SecurityLevels + " | " + ISitemap.SystemSettings.ToString();

            int remiderMode = 0;
            string DocumentRootDirectory = "";
            int intRet = 0;
            intRet = new Auth(null, null, null).GetSystemSetting(out remiderMode, out DocumentRootDirectory);
            if (remiderMode == 1)
            {
                this.rbGroup.Checked = true;
            }
            else
            {
                this.rbResponsible.Checked = true;
            }
            this.txtDocumentDirectory.Text = DocumentRootDirectory;
            this.Session["BaseFolder"] = DocumentRootDirectory;
        }
    }

    protected void Save()
    {
        int iFilterby = this.rbGroup.Checked ? 1 : 0;
        Auth systemSetting = new Auth(null, null, null);
        if (systemSetting.UpdateSystemSetting(iFilterby, this.txtDocumentDirectory.Text) != 0)
        {
        }
    }

}
